<template>
  <div class="runBox">
    <el-card class="box_card">
      <div>
        <el-form :inline="true" :model="formInline" class="demo-form-inline">
          <el-form-item>
            <el-input
              v-model="formInline.name"
              placeholder="用户姓名:"
              style="width: 350px"
            ></el-input>
          </el-form-item>
          <el-form-item>
            <el-input
              v-model="formInline.phone"
              placeholder="用户手机号:"
              style="width: 350px"
            ></el-input>
          </el-form-item>
          <el-form-item label="时间段">
            <el-col :span="11">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="formInline.date1"
                style="width: 100%"
              ></el-date-picker>
            </el-col>
            <el-col class="line" :span="2">-</el-col>
            <el-col :span="11">
              <el-date-picker
                type="date"
                placeholder="选择日期"
                v-model="formInline.date1"
                style="width: 100%"
              ></el-date-picker>
            </el-col>
          </el-form-item>
        </el-form>
        <el-button style="background: #2e71ad; color: #fff" @click="search"
          >查询</el-button
        >
        <el-button style="background: #e3e4e8" @click="onSubmit"
          >清空</el-button
        >
        <div class="title">
          <div class="money">总金额:￥2457.00</div>
          <div class="text">按时间先后排序</div>
        </div>
        <el-table
          :data="tableData"
          border
          stripe
          style="width: 100%"
          :cell-style="rowStyle"
          :header-cell-style="{ background: '#e4ebed', color: '#606266' }"
        >
          <el-table-column prop="date" label="转账时间" align="center">
          </el-table-column>
          <el-table-column prop="name" label="用户姓名" align="center">
          </el-table-column>
          <el-table-column prop="phone" label="用户手机号" align="center">
          </el-table-column>
          <el-table-column prop="type" label="转账方式" align="center">
          </el-table-column>
          <el-table-column label="用户账号" align="center">
            <template slot-scope="scope">
              <div v-if="scope.row.type === '银行卡转账'" class="band">
                <p>开户银行：{{ scope.row.band }}</p>
                <p>银行卡号：{{ scope.row.bandaccount }}</p>
              </div>
              <div v-else>
                <p>{{ scope.row.wx }}</p>
              </div>
            </template>
          </el-table-column>
        </el-table>
        <div class="bottom">
          <span class="page">共57条，每页10条</span>
          <div class="block">
            <el-pagination
              background
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage4"
              :total="57"
              :page-size="10"
              layout="jumper, prev, pager, next "
            >
            </el-pagination>
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formInline: {
        name: "",
        phone: "",
        date1: "",
        date2: "",
      },
      tableData: [
        {
          date: "2016-05-02",
          name: "马老弟",
          phone: "18846772309",
          type: "银行卡转账",
          band: "工商银行",
          bandaccount: "62176528985454561554",
          wx: "",
        },
        {
          date: "2016-05-02",
          name: "马老弟",
          phone: "18846772309",
          type: "微信转账",
          account: "1444561154787799655",
          band: "",
          bandaccount: "",
          wx: "18846772309",
        },
        {
          date: "2016-05-02",
          name: "马老弟",
          phone: "18846772309",
          type: "银行卡转账",
          band: "工商银行",
          bandaccount: "62176528985454561554",
          wx: "",
        },
        {
          date: "2016-05-02",
          name: "马老弟",
          phone: "18846772309",
          type: "微信转账",
          account: "1444561154787799655",
          band: "",
          bandaccount: "",
          wx: "18846772309",
        },
      ],
    };
  },

  mounted() {},

  methods: {
    rowStyle() {
      return "text-align:center";
    },
  },
};
</script>

<style lang="scss" scoped>
.runBox {
  height: 100%;
  padding: 30px 20px;
}
.el-card {
  height: 100%;
}
.box_card {
  height: 100%;
  ::v-deep .el-card__body {
    height: 100%;
  }
}
.line {
  display: flex;
  justify-content: center;
}
.title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 20px;
  .money {
    width: 150px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 4px;
    background: #c95339;
    color: #fff;
  }
  .text {
    line-height: initial;
    color: #999;
    font-size: 16px;
  }
}
::v-deep .cell {
  .band {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    flex-direction: column;
    align-content: center;
    p {
      margin: 0;
    }
  }
}
.bottom {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin: 40px 0px 30px 0px;
  .page {
    font-size: 14px;
    color: #999;
  }
}
</style>